<?php
	include('user.php');
	mysql_connect("localhost", "pigeon", "bois");
	mysql_select_db("pigeon");
	session_start();
	if ($_SESSION['active'] == 1)
	{
		echo "session active";
		$game = &$_SESSION['game'];
		echo $game->players_stat();
	}
	else
	{
		$game = new game();
		$joueur = new player("couille");
		
		$_SESSION['game'] = $game;
		$_SESSION['game'] = 1;
	}
	
?>
<html>
<head>
	<title> this is the pigeon test page </title>
</head>
<?php
	
	
	
	$player1 = new player("bandoine");
	$player2 = new player("tasoss");
	
?>
<body>
	<h1>bienvenu sur la page du PIGE !!!</h1>
	<?
		if($_POST['nbjoueur']){
	//ajout des joueurs	
			$game->ask_player_name();
		}
		else{
		//selection du nombre de joueur
	?>
		<form METHOD="POST" id=joueurs action="index.php">
			<INPUT type=text name="nbjoueur"/>
			<INPUT type=submit /> 
		</form>				
	<?	} 
		print $game->players_name()."<br/>";
		$game->players_stat();
		$game->start();
		
		mysql_close();	
	?>
</body>
</html>
